package com.aios.action.settings.switches;

public class SwitchesEditAction extends AbstractSwitchesAction {

	private static final long serialVersionUID = 1L;
	
	public String execute() {
		
		setMode(Mode.EDIT);
		
		if (id != null) {
			try {
				this.switches = switchService.findById(id);
			} catch (Exception e) {
				// logger
				e.printStackTrace();
				actionError = getText("error.switch.notfound");
				return INPUT;
			}
		}
		else {
			actionError = getText("error.switch.notfound");
			return INPUT;
		}
		
		return SUCCESS;
	}
}
